﻿using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace Sustainalytics.Reporting.BusinessLogic
{
    public interface IRepositoryCollectionAsync<TDocument> : IRepositoryCollectionAsync<TDocument, Guid> where TDocument : IEntity<Guid> { }
    public interface IRepositoryCollectionAsync<TDocument, TKey> where TDocument : IEntity<TKey>
    {
        IMongoCollection<TDocument> Collection { get; }

        Task Save(TDocument document, Guid id, CancellationToken cancellationToken = default(CancellationToken));

        Task BulkInsert(IEnumerable<TDocument> documents, CancellationToken cancellationToken = default(CancellationToken));
    }
}
